<script>
import { useStore } from '@/store';
import { updateApp, updateMini } from '@/utils/updateApp';
import { enabledPermission } from '@/utils/plugin';

export default {
  onLaunch: async function (options) {
    console.log('App onLaunch', options);

    useStore().getEnv();
  },
  onShow: function () {
    this.update();
  },
  methods: {
    update() {
      // #ifdef MP-WEIXIN
      updateMini();
      // #endif
      // #ifdef APP
      updateApp(); // 更新应用wgt包
      enabledPermission();
      // #endif
    }
  }
};
</script>

<style lang="scss">
@import '@/assets/styles/index.scss';
</style>
